package com.prime.tutorial.moviestore.view.reports;

import com.prime.tutorial.moviestore.domain.Device;
import com.prime.tutorial.moviestore.service.reports.ReportsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.List;
/**
 * Provides the view level of the devicesToBeInstalled report.
 * @author vasylja
 */
@Component("devicesToBeInstalled")
@Scope("request")
public class DevicesToBeInstalledImpl {
    private ReportsService reportsService;
    private List<Device> listDevicesToBeInstalled;

    @Autowired
    public DevicesToBeInstalledImpl(ReportsService reportsService) {
        this.reportsService = reportsService;
        setListDevicesToBeInstalled(this.reportsService.getDevicesToBeInstalledReport());
    }

    public List<Device> getListDevicesToBeInstalled() {
        return listDevicesToBeInstalled;
    }

    private void setListDevicesToBeInstalled(List<Device> listDevicesToBeInstalled) {
        this.listDevicesToBeInstalled = listDevicesToBeInstalled;
    }
}
